<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@page import="java.util.*"%>
<%@page import="dyyx.*"%>
<%@page import="dyyx.util.*"%>
<%@page import="dyyx.web.*"%>
<%
    Map<String,Object> map = new HashMap<String,Object>();
    WebUtil.query(request, map);
    String error = WebUtil.getErrorMsg(map);
    if(error!=null){
    	out.println(error);
    	return;
    }
    //
    QueryInfo info = (QueryInfo)map.get("data");
    int maxRows = info.maxRows;
    String sql = info.sql;
    int columnCount = info.resultSetMeta.columnCount;
    List<ColumnInfo> columns = info.resultSetMeta.columns;
    List list =  info.list;
    if(list==null){
    	list = new ArrayList();
    }
    Object[] row = null;
    
 
%>

maxRows <%=maxRows %>  resultListSize <%=list.size() %> <br>


<table border=1>
<tr class="title">
    <td></td>
    <%for(ColumnInfo item:columns){ %>   
    <td><%=item.columnName %></td> 
    <%} %>

</tr>


<%
    int seq = 0;
    for(Object item:list){	
	    row = (Object[])item;
	    seq++;
%>
<tr>
       <td><%=seq %></td>
       <% for(int i=0;i<columnCount;i++) {%>
           <td><%=row[i] %></td>
       
       <%} %>

</tr>
<%} %>

<table>


<style>

  table{
            border-collapse: collapse;
            border: none;
            width: 100%;
        }
        td{
            border: solid gray 1px;
            vertical-align: top;
        }

        .title td{
            height:39px;
            text-align:center;
            font-weight:bold;
            background-color:silver;
             vertical-align: middle;

        }
</style>




